<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <style>

    </style>
</head>

<body>
    <label>Hello APP</label>
    <div id='sys-info'></div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script>
    // apiready = function() {
    // var bmLocation = api.require('bmLocation');
    //     bmLocation.singleLocation({
    //       reGeocode: false,
    //       netWorkState: false
    //     }, function(ret) {
    //     console.log(JSON.stringify( ret ) )
    //       var sta = ret.status;
    //       if (sta) {
    //           var lat = ret.location.latitude;
    //           var lon = ret.location.longitude;
    //           var t = ret.timestamp;
    //           var city=ret.city
    //           var str = '经度：' + lon + '<br>';
    //           str += '纬度：' + lat + '<br>';
    //           // str +='城市：' + city +'<br>'
    //           api.alert({ msg: str });
    //           var showLocation = function (json){
    //                   console.log(json);
    //               }
    //        $.ajax({
    //           url : 'http://api.map.baidu.com/reverse_geocoding/v3/',
    //           type : 'GET',
    //           async:false,
    //           dataType: 'json',
    //           json: 'callback',
    //           jsonpCallback:"showLocation",
    //           data : {
    //               output:"json",
    //               location:lat,lon,
    //               ak:"AR7CcTQGckc9xKja73Up8fC0RCkoO3Nr",
    //               pois:1,
    //           },
    //           success: function (json) {
    //             console.log(JSON.stringify(json));
    //           },
    //           error: function (xhr, textStatus, errorThrown) {
    //             document.write("错误原因"+errorThrown);
    //           }
    //         })
    //
    //             } else {
    //                 api.alert({ msg: '发生错误' });
    //             }
    //           });
    apiready = function() {
        var ver = api.version;
        var sType = api.systemType;
        var sVer = api.systemVersion;
        var id = api.deviceId;
        var model = api.deviceModel;
        var name = api.deviceName;
        var cType = api.connectionType;
        var winName = api.winName;
        var winWidth = api.winWidth;
        var winHeight = api.winHeight;
        var frameName = api.frameName || '';
        var frameWidth = api.frameWidth || '';
        var frameHeight = api.frameHeight || '';
        var uiMode = api.uiMode;
        var appId = api.appId;
        var appName = api.appName;
        var appVersion = api.appVersion;
        var systemType = api.systemType;
        var systemVersion = api.systemVersion;
        var version = api.version;
        var deviceId = api.deviceId;
        var deviceModel = api.deviceModel;
        // var deviceToken = api.deviceToken;


        var str = '<ul>';
        str += '<li>引擎版本信息: ' + ver + '</li>';
        str += '<li>系统类型: ' + sType + '</li>';
        str += '<li>系统版本: ' + sVer + '</li>';
        str += '<li>设备标识: ' + id + '</li>';
        str += '<li>设备型号: ' + model + '</li>';
        str += '<li>设备名称: ' + name + '</li>';
        str += '<li>网络状态: ' + cType + '</li>';
        str += '<li>主窗口名字: ' + winName + '</li>';
        str += '<li>主窗口宽度: ' + winWidth + '</li>';
        str += '<li>主窗口高度: ' + winHeight + '</li>';
        str += '<li>子窗口名字: ' + frameName + '</li>';
        str += '<li>子窗口宽度: ' + frameWidth + '</li>';
        str += '<li>子窗口高度: ' + frameHeight + '</li>';
        str += '<li>设备类型：' + uiMode + '</li>';
        str += '<li>应用的id：' + appId + '</li>';
        str += '<li>应用在桌面上显示的名称 ：' + appName + '</li>';
        str += '<li>应用版本号：' + appVersion + '</li>';
        str += '<li>系统类型：' + systemType + '</li>';
        str += '<li>手机平台的系统版本 :' + systemVersion + '</li>';
        str += '<li>引擎版本信息 ：' + version + '</li>';
        str += '<li>设备唯一标示：' + deviceId + '</li>';
        // str +='<li>ios推送的devicetoken：' + deviceToken +'</li>'
        str += '<li>设备型号：' + deviceModel + '</li>'
        str += '</ul>';
        $api.byId('sys-info').innerHTML = str;


    };
</script>



</html>
